package com.lhy.framework.beans;

import cn.hutool.core.util.StrUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName PropertyValue
 * @Description
 * @Author lihaiyang
 * @Date 2022/9/9 00:20
 * @Version 1.0
 */
public class PropertyValues {

    private List<PropertyValue> propertyValueList = new ArrayList<>();

    public void addPropertyValue(PropertyValue propertyValue) {
        propertyValueList.add(propertyValue);
    }

    public List<PropertyValue> getPropertyValues() {
        return propertyValueList;
    }

    public PropertyValue getPropertyValue(String propertyName) {
        for (PropertyValue propertyValue : propertyValueList) {
            if (StrUtil.equals(propertyName, propertyValue.getName())) {
                return propertyValue;
            }
        }
        return null;
    }
}
